package com.endurance.handler.factory;

import com.endurance.handler.impl.BlacklistHandler;
import com.endurance.handler.impl.ConversationHandler;
import com.endurance.handler.impl.CurrentLimitHandler;

/**
 * @Author: sunlin
 * @Date: 2024-05-04 17:55
 * @Version: 1.0
 * @Description:
 */
public class HandlerFactory {


    public static CurrentLimitHandler getFirstGatewayHandler() {

        // 第一步
        CurrentLimitHandler currnetLimitHandler = new CurrentLimitHandler();
        // 第二步
        BlacklistHandler blacklistHandler = new BlacklistHandler();
        // 第三步
        ConversationHandler conversationHandler = new ConversationHandler();

        currnetLimitHandler.setNextGatewayhandler(blacklistHandler);
        blacklistHandler.setNextGatewayhandler(conversationHandler);

        return currnetLimitHandler;
    }

}
